/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */
import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View
} from 'react-native';
import SplashScreen from 'react-native-splash-screen'
import ThemeDao from './js/expand/dao/ThemeDao'
import NavigatorUtil from "./js/util/NavigatorUtil";


export default class App extends Component {

    constructor(props)
    {
        super(props);
    }

    componentWillUnmount() {
        this.timer && clearTimeout(this.timer);
    }

    componentDidMount() {
        // do stuff while splash screen is shown
        // After having done stuff (such as async tasks) hide the splash screen
        new ThemeDao().getTheme().then((data) => {
            this.theme = data;
        })
        this.timer = setTimeout(() => {
            SplashScreen.hide();
            NavigatorUtil.resetToHomePage({
                theme: this.theme,
                navigation: this.props.navigation,
                selectedTab:2,
                props1:this.props
            })
        }, 500);
    }

    render() {
        return null;
    }
}
const styles = StyleSheet.create({
    tips: {
        fontSize: 18
    }
});
